package com.qf.netty.application;

import com.qf.netty.core.NettyServer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * SpringBoot启动时调用的类
 * author Ken
 * create_time 2023/1/4
 */
@Component
@Slf4j
public class ApplicationRunning implements CommandLineRunner {

    @Autowired
    private NettyServer nettyServer;

    @Override
    public void run(String... args) throws Exception {
        log.info("[Application Running] SpringBoot服务器启动，启动Netty服务端...");
        //启动Netty服务器
        nettyServer.started();
    }
}
